<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="update">点击</button>
    </div>

    <script>
        var app =new Vue({
            el: '#app',
            data: {
                msg: 'hello'
            },
            methods: {
                update() {
                    this.msg = 'world'
                    console.log(this.msg);
                }
            },
            beforeCreate() {
                console.log('beforeCreate');
            },
            created() {
                console.log('created');
            },
            beforeMount() {
                console.log('beforeMount');
            },
            mounted() {
                console.log('mounted');
            },
            beforeUpdate() {
                console.log('beforeUpdate');
            },
            Update() {
                console.log('Update');
            }
        })
    </script>
</body>
</html>